<script setup>
import { formatToWan } from '../common/index'

const props = defineProps({
  item: {
    type: Object,
    default() {
      return {}
    }
  }
})
</script>

<template>
  <div class="list-warp">
    <img :src="item.picUrl || item.coverImgUrl" alt="" />
    <div class="play-count">
      <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-bendi-bendiyinle"></use>
      </svg>
      <span>{{ formatToWan(item.playCount) }}</span>
    </div>
    <div class="list-name">
      <span>{{ item.name }}</span>
    </div>
  </div>
</template>

<style scoped lang="scss">
.list-warp {
  width: 180px;
  height: 240px;
  position: relative;
  cursor: pointer;
  img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
  }
  &:after {
    content: "";
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    position: absolute;
    left: 0;
    top: 0;
  }
}
.play-count {
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1px;
  border-radius: 50px;
  z-index: 1;
  position: absolute;
  right: 12px;
  top: 8px;
  .icon {
    font-size: 14px;
    font-weight: bold;
    margin-right: 4px;
  }
}
.list-name{
  width: 100%;
  height: 40px;
  font-size: 12px;
  color: #fff;
  letter-spacing: 1px;
  box-sizing: border-box;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0 0 12px 12px;
  z-index: 1;
  position: absolute;
  left: 0;
  bottom: 0;
}
</style>
